1 Imports System.IO
2 Public Class frmLogin
3
4 #Region
"Controlbox"
5
6     Private Sub btnClose_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnClose.Click
7         End
8     End Sub
9
10     Private Sub btnMin_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnMin.Click
11         Me.WindowState = FormWindowState.Minimized
12     End Sub
13
14 #End Region
15
16     Private Sub Btncancel_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Btncancel.Click
17         End
18     End Sub
19
20     Private Sub BtnLogin_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtnLogin.Click
21         Try
22             Dim reader As New StreamReader(Application.StartupPath &
"\pass.dat")
23             Dim pass As String = reader.ReadLine
24             reader.Close()
25             If txtPass.Text.ToLower = pass Then
26                 Me.Close()
27                 frmMenu.MdiParent = Main
28                 frmMenu.Show()
29             Else
30                 MessageBox.Show(
"You have enetered an invalid password. Please try again.", "Invalid Password", MessageBoxButtons.OK, MessageBoxIcon.Warning)
31                 txtPass.Focus()
32                 txtPass.SelectAll()
33             End If
34         Catch ex As Exception
35         End Try
36     End Sub
37
38 End Class


Gõ tìm kiếm nhanh...